package com.hongye.manager.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hongye.common.entity.OrderEntity;
import com.hongye.manager.mapper.OrderMapper;
import com.hongye.manager.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;


    @Override
    public List<OrderEntity> selectUserPage(Page<OrderEntity> page, String name) {

        QueryWrapper<OrderEntity> qw = new QueryWrapper<>();
        qw.like("customer_name",name);

        IPage<OrderEntity> page1 = orderMapper.selectPage(page, qw);
        List<OrderEntity> records = page1.getRecords();
        return records;
    }
}
